﻿<local:GroupWindowBase x:Class="Rio.Framework.Pages.ChildWindows.GroupFilterWindow"
                   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                   xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                   xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
                   xmlns:Grid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
                   xmlns:gridViewElements="clr-namespace:Telerik.Windows.Controls.GridView;assembly=Telerik.Windows.Controls.GridView"
                   xmlns:local="clr-namespace:Rio.Framework.Pages.ChildWindows"    
                   xmlns:Converter="clr-namespace:Rio.Framework.Pages.Helpers.Converter"
                   Header="Groupe(s)/Utilisateur(s)"
                   xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                   Width="600"
                   Height="460"
                   DialogResult="False">

    <Grid x:Name="LayoutRoot"
          Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition  Height="40" />
            <RowDefinition  Height="*" />
            <RowDefinition Height="40" />
        </Grid.RowDefinitions>

        <Grid.Resources>
            <Converter:FieldToImageConverter x:Key="FieldToImageConverter" />

        </Grid.Resources>
        <StackPanel Orientation="Horizontal"
                    Margin="0,5,0,5">
            <TextBlock Name="LabelStartingWith"
                       Text="Commençant par: "
                       VerticalAlignment="Center" />
            <TextBox Name="TextBoxStartingWith"
                     Width="200"
                     Height="25"
                     TextChanged="FilterValue_TextChanged" />
        </StackPanel>
        <Grid:RadGridView x:Name="GridViewMessages"
                          SelectionMode="Multiple"
                          AutoGenerateColumns="False"
                          CanUserDeleteRows="False"
                          ItemsSource="{Binding SelectedItemListMessage}"
                          ShowGroupPanel="False"
                          IsFilteringAllowed="True"
                          Grid.Row="1">
            <Grid:RadGridView.Columns>
                <Grid:GridViewSelectColumn x:Name="ColSelection"
                                           MaxWidth="30">
                    <Grid:GridViewSelectColumn.Header>
                        <CheckBox x:Name="chkSelectAll"
                                  IsChecked="False"
                                  Checked="chkSelectAll_Checked"
                                  Unchecked="chkSelectAll_Unchecked" />
                    </Grid:GridViewSelectColumn.Header>
                </Grid:GridViewSelectColumn>
                <Grid:GridViewDataColumn x:Name="IsUser"
                                         Header=""
                                         IsReadOnly="True"
                                         MinWidth="40"
                                         MaxWidth="40"
                                         DataMemberBinding="{Binding MyDocEtat}">
                    <Grid:GridViewDataColumn.CellTemplate>
                        <DataTemplate>
                            <Image Source="{Binding IsUser, Converter={StaticResource FieldToImageConverter}}"
                                   HorizontalAlignment="Center"
                                   VerticalAlignment="Center"
                                   Width="20"
                                   Height="20" />
                        </DataTemplate>
                    </Grid:GridViewDataColumn.CellTemplate>
                </Grid:GridViewDataColumn>
                <Grid:GridViewDataColumn x:Name="GroupName"
                                         Header="Nom"
                                         IsReadOnly="True"
                                         DataMemberBinding="{Binding Name}" />
            </Grid:RadGridView.Columns>
        </Grid:RadGridView>
        <StackPanel Orientation="Horizontal"
                    Grid.Row="2"
                    HorizontalAlignment="Right">
            <Button Name="SetGroupItemButton"
                    Content="OK"
                    HorizontalAlignment="Right"
                    Height="30"
                    Width="100"
                    Margin="0,5,0,5"
                    Click="SetGroupItemButton_Click" />
            <Button Name="CancelGroupItemButton"
                    Content="Annuler"
                    HorizontalAlignment="Right"
                    Height="30"
                    Width="100"
                    Margin="5,0,5,0"
                    Click="SetGroupItemCancel_Click" />
        </StackPanel>
    </Grid>
</local:GroupWindowBase>